package com.skt.common_hr.healthcheckup.model
{
	import com.skt.common_hr.common.puremvc.CommonProxy;
	import com.skt.common_hr.healthcheckup.HealthCheckUpFacade;
	
	import mx.rpc.events.FaultEvent;
	import mx.rpc.events.ResultEvent;

	public class ClosingDayProxy extends CommonProxy
	{
		public static const NAME:String = "ClosingDayProxy";
		
		public var outOfDate:Boolean = true;	
	
		/**
		 * 생성자
		 * 
		 * @param
		 * @return void
		 */
		public function ClosingDayProxy(data:Object=null)
		{
			super(NAME, data);
		}
		
		//신청마감일
		public function loadClosingDay():void
		{
			var params:Object = new Object();
			loadData("Z_HR_0093", params, result, fault);
		}
		
		public function result(event:ResultEvent):void
		{
			if(retCode==0) {
				outOfDate = false;
				facade.sendNotification(HealthCheckUpFacade.LOAD_END_DAY_COMPLETE, this);
			}
			else {
				trace( "failed to load cong: (" +event.result["RETCODE"] + ") "+event.result["RETTEXT"]);
				outOfDate = true;
				facade.sendNotification(HealthCheckUpFacade.LOAD_END_DAY_FAILED, this);
			}
		}
		
		private function fault(event:FaultEvent):void
		{
			outOfDate = true;
			facade.sendNotification(HealthCheckUpFacade.LOAD_END_DAY_FAILED, this);
		}
		
	}
}